package com.diepu.www.client.hzicbc.proxy.response;

import java.io.Serializable;
/**
 * 公共响应
 * @author xiongxiaotun
 *
 */
public class PublicResponse implements Serializable{
	private static final long serialVersionUID = 1L;
	/**
	 * 返回代码<br/>
	 * 长度 ：5<br/>
	 * 说明：00000– 成功<br/>
	 * 1****-参数上送错误(修改参数后可直接重复提交)<br/>
	 * 2****-程序处理错误(含业务规则控制不符等)<br/>
	 * 3****-系统错误(出现此错误先通知我们之后可以重新提交)<br/>
	 */
	private String  retcode;
	
	/**
	 * 返回信息<br/>
	 * 长度 ：200<br/>
	 */
	private String retmsg;

	public String getRetcode() {
		return retcode;
	}

	public void setRetcode(String retcode) {
		this.retcode = retcode;
	}

	public String getRetmsg() {
		return retmsg;
	}

	public void setRetmsg(String retmsg) {
		this.retmsg = retmsg;
	}	
	
	/**
	 * 成功
	 * @return
	 */
	public static PublicResponse success() {
		PublicResponse pub = new PublicResponse();
		pub.setRetcode("00000");
		pub.setRetmsg("成功");
		return pub;
	}
	/**
	 * 失败：参数上送错误
	 * @return
	 */
	public static PublicResponse failParam() {
		PublicResponse pub = new PublicResponse();
		pub.setRetcode("10000");
		pub.setRetmsg("参数上送错误");
		return pub;
	}
	/**
	 * 失败：程序处理错误
	 * @return
	 */
	public static PublicResponse failBusi() {
		PublicResponse pub = new PublicResponse();
		pub.setRetcode("20000");
		pub.setRetmsg("程序处理错误");
		return pub;
	}
	/**
	 * 失败：程序内部错误
	 * @return
	 */
	public static PublicResponse failError() {
		PublicResponse pub = new PublicResponse();
		pub.setRetcode("30000");
		pub.setRetmsg("系统错误");
		return pub;
	}
}
